If you have problems or suggestions, email <support@stairways.com.au>. Please note that I will probably be quite brutal about suggestions for extending this program - in all likelihood, if you want more than this program can provide, you should be using Rez or Resorcerer.
Purpose
The ictb compiler compiles text file descriptions of dialog item colour tables in to appropriate resources (namely the 'ictb' resource) for use by the Dialog Manager in displaying dialogs. Since ResEdit cannot handle creating ictb’s and it is not possible to write a ResEdit template for them, it makes sense to have a CodeWarrior plugin compiler to create them. And with Metrowerks plugin compiler technology and this compiler, you can add the text file directly to your project and have it built automatically in the make process.
Installation
Drop the “ictb” file in to the “Compilers” folder in the “CodeWarrior Plugins” folder. Quit the CodeWarrior IDE if it is running, and then launch it.
In each project, choose Preferences from the Edit menu and select Target. Type “TEXT” in to the File Type field, type “.bh” (or whatever you like) in to the Extension field, and select Balloon Help from the Compiler popup menu. Click the Add button. This step may not be neccessary in modern versions of CodeWarrior (CW11 and later).
You might like to modify your standard stationery files to include this file mapping information.
Using the Compiler
In a project when you want to add ictb resources for dialogs, add a .ictb file in the correct format (as specified below). When you Make the application, CodeWarrior will compile the file and add the resources.
The file format is pretty simple. For each dialog you simply list out the items with the font information. For example:
ictb=128
-
-
Geneva,9,1
Geneva,9,0
Geneva,12,7
Geneva,9,0
Monaco,9,0
Geneva,9,0
end-ictb
END
Warning: There is no checking to ensure that the dialog attached to this ictb dialog (DLOG id 128) will have the correct number of items. If it does not, your application will likely crash (and ResEdit may also crash if you try to edit the application).
Note: The Dialog Manager will not use the ictb resource unless you have a dctb resource as well. You can simply create an eight byte one '0000 0000 0000 FFFF'.
Note: For edit text items to work properly, you must use the SetDialogTextFont code. All edit text items must be the same font/size. See MacTech May 1997, pg 110 Q&A for the reason this is required.
Note: Geneva 9 items should be 12 pixel high.
Formal Specification
• Lines are limited to 254 characters.
• White space at the start or end of a line is trimmed
• Lines starting with one of #;/*{ are comments and are ignored completely.
• The file is case-insensitive (although the font names should be the same case).
A single space below means <whitespace>.
Dialog Help Text
ICTB = <id>
<items>
END-ICTB
<items> is one or more <item> lines.
<item> is <font name>,<size>,<face>
<font name> is the name of a font. Ensure the font will exist. Translators can localize the font name in the ictb, but it is not quite trivial.
<size> is the font size in points.
<face> is the font face as an 8-bit decimal number.
bold is $01, italic is $02, underline is $04, outline is $08,
shadow is $10, condense is $20, extend is $40. Add them together to get the font face
Soft End-Of-File
END
Terminates the file, nothing after this point is processed.
Limitations
Requires CodeWarrior 7 or later.
Small Print
This program is free.
Warranty
This program should do what I’ve described in this document. If it doesn’t, you can simply stop using it.
Fine Print
Peter N Lewis and Stairways Software Pty Ltd hereby disclaims all warranties relating to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose. Neither Peter N Lewis nor Stairways Software Pty Ltd will be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason, even if Peter N Lewis, Stairways Software Pty Ltd or an agent of his has been advised of the possibility of such damages. In no event shall Peter N Lewis or Stairways Software Pty Ltd be liable for any damages, regardless of the form of the claim. The person using the software bears all risk as to the quality and performance of the software.
US Government:
Government End Users: If you are acquiring the Software and fonts on behalf of any unit or agency of the United States Government, the following provisions apply. The Government agrees:
(i) if the Software and fonts are supplied to the Department of Defense (DoD), the Software and fonts are classified as "Commercial Computer Software" and the Government is acquiring only "restricted rights" in the Software, its documentation and fonts as that term is defined in Clause 252.227-7013(c)(1) of the DFARS; and
(ii) if the Software and fonts are supplied to any unit or agency of the United States Government other than DoD, the Government's rights in the Software, its documentation and fonts will be as defined in Clause 52.227-19(c)(2) of the FAR or, in the case of NASA, in Clause 18-52.227-86(d) of the NASA Supplement to the FAR.
Acknowledgements
Thanks go to Metrowerks for making such a fine compiler, for saving Pascal (which I use for most of my programs including this one), for having great tech support, and for opening their environment to plugin compiler writers.